﻿$(document).ready(function () {

    $("#list").jqGrid({
        height: 300,
        width: 800,
        url: '/Customer/GetCustomersData/',
        datatype: 'json',
        mtype: 'POST',
        colNames: ['Id', 'Name'],
        colModel: [
          { name: 'Id', index: 'Id', width: 300, sortable: false },
          { name: 'Name', index: 'Name', width: 500, editable: true, class: 'required', sortable: false, editrules: {required: true} }
          ],
        pager: jQuery('#pager'),
        rowNum: 10,
        rowList: [10, 50],
        sortname: 'name',
        sortorder: "asc",
        viewrecords: true,
        imgpath: '/Content/images',
        caption: 'Customers',
    }).navGrid('#pager', { edit: false, add: true, del: false, search: false }, {}, { addCaption: 'Add a customer', url: '/Customer/New/', closeAfterAdd: true, reloadAfterSubmit: true, afterSubmit: jqgridHelpers.after_submit });
}); 